<template>
  <router-view v-slot="{ Component }">
    <transition
      name="fade"
      mode="out-in"
      @before-enter="scrollToTop"
    >
      <component :is="Component" />
    </transition>
  </router-view>
</template>

<style>
.fade-enter-active,
.fade-leave-active {
  transition: opacity 0.3s ease;
}

.fade-enter-from,
.fade-leave-to {
  opacity: 0;
}
</style>

<style>
.slide-enter-active {
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
.slide-enter-from {
  transform: translateX(20px);
  opacity: 0;
}
</style>